﻿// ------------------------------------------------------------------------------------
//      Copyright (c) uhavemyword@gmail.com. All rights reserved.
//      Created by Ben at 2/20/2013 4:01:33 PM
// ------------------------------------------------------------------------------------

namespace CP.NLayer.Models.Business
{
    using System.ComponentModel.DataAnnotations;
    using CP.General;
    using CP.NLayer.Resources.Model;

    public class UserDisplayModel
    {
        private string _roleNames;

        public string Id { get; set; }

        [Display(Name = MResourceNames.UserName, ResourceType = typeof(MResources))]
        public string LoginName { get; set; }

       [Display(Name = MResourceNames.User_FullName, ResourceType = typeof(MResources))]
        public string FullName { get; set; }

       [Display(Name = MResourceNames.IsActive, ResourceType = typeof(MResources))]
        public bool IsActive { get; set; }

        [Display(Name = MResourceNames.Role_Name, ResourceType = typeof(MResources))]
        public string RoleNames
        {
            get
            {
                return _roleNames.Truncate();
            }
            set
            {
                _roleNames = value;
            }
        }

        public override string ToString()
        {
            return this.LoginName;
        }
    }
}
